import { request } from '$lib/utils/request/request-server';
import type { loginForm } from '$lib/api/types/user'
import type { RequestEvent } from '@sveltejs/kit';
//统一管理接口
enum API {
	LOGIN_URL = '/auth/login',
	LOGOUT_URL = "/auth/logout",
	UserInfo_URL = "/itp/api/menu/find/currentUser", 
}
//登录接口方法
export const reqLogin = (event:RequestEvent,data: loginForm) => request(event).post(API.LOGIN_URL, data);
//登出
export const reqLogout = (event:RequestEvent) => request(event).post(API.LOGOUT_URL);
//获取用户及权限信息
export const reqUserInfo = (event:RequestEvent) => request(event).get(`${API.UserInfo_URL}?dictMenuPlan=3&isShow=0`);